package com.dhl.fin.api.dto;

import cn.hutool.core.date.DateUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

/**
 * @author CuiJianbo
 * @since 2025/5/20
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MensesCalenderMonthDataDTO {

    private String yearMonth;

    private List<MensesCalenderDTO> mensesCalenderDTOS;

    public static MensesCalenderMonthDataDTO getInstance(Date nextMensesDate, List<MensesCalenderDTO> mensesCalenderDTOS) {
        String yearMonth = DateUtil.format(nextMensesDate, "yyyy-MM");
        MensesCalenderMonthDataDTO mensesCalenderResponseDTO = new MensesCalenderMonthDataDTO();
        mensesCalenderResponseDTO.yearMonth = yearMonth;
        mensesCalenderResponseDTO.mensesCalenderDTOS = mensesCalenderDTOS;
        return mensesCalenderResponseDTO;
    }
}
